var a = 1

function foo() {
  var a = 2
}

foo()

console.log(a);




